/*
 * common.h
 *
 *  Project Name: ratbox-monitor
 *    Created on: Oct 16, 2010
 *        Author: Daniel J Reidy <dubkat@ratbox.org>
 *            Id: $Id: common.h 50 2012-04-04 03:46:50Z dubkat $
 */

#ifndef COMMON_H_
#define COMMON_H_

#define MONITOR_URL "http://www.ratbox.org"

#define IRCD_BUFSIZE 512
#define CONFIG_RATBOX_LEVEL_3 1
#define SEED_BAN_MIN 2500

#define MAX_NICKLEN 10		// 9 + \0
#define MAX_USERHOST_LEN MAX_NICKLEN+MAX_NICKLEN+255+4+1 // nick!~user@host.name\0

#define PCRE_MAX_MATCH_COUNT 20
#define MAX_TABLE_SIZE 50

#define EmptyString(x) ((x == NULL) || (*(x) == '\0'))
#define CheckEmpty(x) EmptyString(x) ? "" : x

enum YesNo
{
	NO,
	YES,
};

// who i am on irc
struct status
{
	int id;			/* we'll use this field as the key */
	char wantednick[10];	// XXX size should be defined somewhere
	char currentnick[10];
	char umodes[25];
	int foreground;
	unsigned int start_time;
} my_status;


struct conn
{
	rb_fde_t *F;
	buf_head_t recvq;
	buf_head_t sendq;
};

struct server
{
	int id;
	char servername[255];
	char version[25];
	char umodes[30];
	char network[30];
	int nicklen;
	int chanlen;
	int cprivmsg;
	int cnotice;
	int etrace;
	int hasExtendedInfo;
	int fnc;
} my_server;


#endif